package rudy.elevator.thread;

import rudy.elevator.bean.LiftBean;
import rudy.elevator.ui.MainPanel;

public class  OpenThread extends Thread {
    LiftBean lift;
    MainPanel panel;
    public  OpenThread(LiftBean lift, MainPanel panel) {
        this.lift = lift;
        this.panel = panel;
    }

    public void run() {

        for (int i = 0; i < lift.getDx() / 2; i++) {
    lift.setXx(i + 1);
    try {
        Thread.sleep(5);
    } catch (InterruptedException ex) {
    }
    panel.repaint();
    }

    }
    }
